flatTap

inline fun <A, E, B> Outcome<E, A>.flatTap(f: (A) -> Outcome<E, B>): Outcome<E, A>(source)

Performs a flatMap across the supplied function, propagating failures or absence but preserving the original present value.

1.present().flatTap { a -> "bad".failure() } // Failure("bad")
1.present().flatTap { a -> Absent } // Absent
1.present().flatTap { a -> a + 2 } // Present(1) -- value preserved